<div class="modal" style="display: block;">
  <div class="modal-dialog">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close" ui-sref="^">
          <span aria-hidden="true">×</span>
        </button>
        <h4 class="modal-title" ng-bind="current_bread"></h4>
      </div>
      <div class="modal-body">
        <form class="form-horizontal" id="accounting_sub_modal">
          <div class="nav-tabs-custom" style="box-shadow:none;">
            <ul class="nav nav-tabs">
              <li ng-class="{'active': activeTab == 0}"><a data-toggle="tab"  ng-click="onTab(0)">基本信息</a></li>
              <li ng-class="{'active': activeTab == 2}"><a data-toggle="tab" ng-click="onTab(2)">人员信息</a></li>
              <li ng-class="{'active': activeTab == 1}"><a data-toggle="tab" ng-click="onTab(1)" ng-if="subData.tax == 1">开票信息</a></li>
            </ul>
            <div class="tab-content">
              <div class="tab-pane" ng-class="{'active': activeTab == 0}">
                <div class="form-group">
                  <label class="col-sm-2 control-label">账期<span class="required">*</span></label>
                  <div class="col-sm-3">
                    <input type="text" class="form-control date-input" id="date_start" name="date_start" ng-model="subData.date_start">
                  </div>
                  <div class="col-sm-3">
                    <input type="text" class="form-control date-input" id="date_end" name="date_end" ng-model="subData.date_end">
                  </div>
                </div>
                <div class="form-group">
                  <label class="col-sm-2 control-label">成交日期<span class="required">*</span></label>
                  <div class="col-sm-6">
                    <input type="text" class="form-control date-input" id="date_transaction" name="date_transaction" ng-model="subData.date_transaction" data-rule="required;">
                  </div>
                </div>
                <div class="form-group">
                  <label class="col-sm-2 control-label">成交金额<span class="required">*</span></label>
                  <div class="col-sm-6">
                    <input
                      type="text"
                      class="form-control"
                      name="amount_transaction"
                      ng-model="subData.amount_transaction"
                      data-rule="required;"
                      data-rule-money="[/^(([1-9]\d{0,9})|0)(\.\d{1,2})?$/, '请填写2位小数的数值']"
                      data-rule="money;"
                    />
                  </div>
                </div>

                <div class="form-group">
                  <label class="col-sm-2 control-label">付款方式<span class="required">*</span></label>
                  <div class="col-sm-6">
                    <select class="form-control select2" name="pay_mode" ng-model="subData.pay_mode" data-rule="required;">
                      <option value="">请选择</option>
                      <option value="1">月付</option>
                      <option value="3">季付</option>
                      <option value="6">半年</option>
                      <option value="12">每年</option>
                    </select>
                  </div>
                </div>

                <div class="form-group">
                  <label class="col-sm-2 control-label">是否含税<span class="required">*</span></label>
                  <div class="col-sm-6">
                    <select class="form-control select2" name="tax" ng-model="subData.tax" data-rule="required;">
                      <option value="">请选择</option>
                      <option value="0">否</option>
                      <option value="1">是</option>
                    </select>
                  </div>
                </div>
                <div class="form-group">
                  <label class="col-sm-2 control-label">其他事项</label>
                  <div class="col-sm-6">
                    <textarea class="form-control" rows="3" name="memo" ng-model="subData.memo" data-rule="length[~300];"></textarea>
                  </div>
                </div>
              </div>
              <div class="tab-pane" ng-class="{'active': activeTab == 2}">
                <div class="form-group">
                  <label class="col-sm-2 control-label">客户归属<span class="required">*</span></label>
                  <div class="col-sm-6">
                    <!-- <select
                      ui-select2
                      class="form-control select2"
                      id="salesmanSelect2"
                      name="salesman_id"
                      ng-view="salesman"
                      ng-model="subData.salesman_id"
                      data-rule="required;"
                      url="Member/List"
                      paging="true"
                      style="width: 100%;"
                    >
                    </select>
                    <span id="salesmanSelect2-validator" class="select-validator"></span> -->
                    <input type="text" class="form-control" ng-model="data.salesman" disabled>
                  </div>
                </div>

                <div class="form-group">
                  <label class="col-sm-2 control-label">订单归属</label>
                  <div class="col-sm-6">
                    <input type="text" class="form-control" ng-model="subData.creator" disabled>
                  </div>
                </div>

                <div class="form-group">
                  <label class="col-sm-2 control-label">渠道商</label>
                  <div class="col-sm-6">
                    <select
                      ui-select2
                      class="form-control select2"
                      id="traderSelect2"
                      name="trader_id"
                      ng-view="trader_name"
                      ng-model="subData.trader_id"
                      data-formatfields="code,text"
                      data-formatcaptions="编号,名称"
                      url="Customer/SearchForDropdown"
                      paging="true"
                      style="width: 100%;"
                      readonly
                    ></select>
                    <span id="traderSelect2-validator" class="select-validator"></span>
                  </div>
                </div>

                <div class="form-group">
                  <label class="col-sm-2 control-label">助理</label>
                  <div class="col-sm-6">
                    <select
                      ui-select2
                      class="form-control select2"
                      id="assistantSelect2"
                      allowclear="true"
                      name="assistant_id"
                      ng-view="assistant_name"
                      ng-model="subData.assistant_id"
                      url="Member/List"
                      paging="true"
                      style="width: 100%;"
                    >
                    </select>
                  </div>
                </div>
                <div class="form-group">
                  <label class="col-sm-2 control-label">经理</label>
                  <div class="col-sm-6">
                    <select
                      ui-select2
                      class="form-control select2"
                      id="managerSelect2"
                      allowclear="true"
                      name="manager_id"
                      ng-view="manager_name"
                      ng-model="subData.manager_id"
                      url=" Member/List"
                      paging="true"
                      style="width: 100%;"
                    >
                    </select>
                  </div>
                </div>
              </div>
              <div class="tab-pane" ng-class="{'active': activeTab == 1}" ng-if="subData.tax == 1">
                <div class="form-group">
                  <label class="col-sm-2 control-label">名称<span class="required">*</span></label>
                  <div class="col-sm-6">
                    <input type="text" class="form-control" name="invoice_name" ng-model="subData.invoice_name" data-rule="required;">
                  </div>
                </div>
                <div class="form-group">
                  <label class="col-sm-2 control-label">纳税人识别号<span class="required">*</span></label>
                  <div class="col-sm-6">
                    <input type="text" class="form-control" name="invoice_tax" ng-model="subData.invoice_tax" data-rule="required;">
                  </div>
                </div>
                <div class="form-group">
                  <label class="col-sm-2 control-label">地址<span class="required">*</span></label>
                  <div class="col-sm-6">
                    <input type="text" class="form-control" name="invoice_address" ng-model="subData.invoice_address" data-rule="required;">
                  </div>
                </div>
                <div class="form-group">
                  <label class="col-sm-2 control-label">电话</label>
                  <div class="col-sm-6">
                    <input type="text" class="form-control" name="invoice_tel" ng-model="subData.invoice_tel">
                  </div>
                </div>
                <div class="form-group">
                  <label class="col-sm-2 control-label">开户行<span class="required">*</span></label>
                  <div class="col-sm-6">
                    <input type="text" class="form-control" name="invoice_bank" ng-model="subData.invoice_bank" data-rule="required;">
                  </div>
                </div>
                <div class="form-group">
                  <label class="col-sm-2 control-label">开户行账号<span class="required">*</span></label>
                  <div class="col-sm-6">
                    <input type="text" class="form-control" name="invoice_account" ng-model="subData.invoice_account" data-rule="required;">
                  </div>
                </div>
              </div>
            </div>
          </div>
        </form>
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-default pull-left" data-dismiss="modal" ui-sref="^">取消</button>
        <button type="button" class="btn btn-primary" ng-click="save()">保存</button>
      </div>
    </div>
  </div>
</div>
